<template>
    <div>
        <h1>{{ title }}</h1>
        <span>{{ name }}</span><br>
        <button @click="fun">点击收藏 {{ title }}</button>
        <h1>{{ tableData }}</h1>
    </div>
</template>

<script>
import axios from "axios"
// 导出
export default {

    props: ["title", "name"],

    data: function () {
        return {
            tableData:null,
        }
    },
    created: function () {
        // axios.get("http://localhost:8080/user").then((response) => {
        //     console.log(response.data);
        //     this.tableData = response.data
        // }
        // )
        console.log("Hello 组件被创建了")
    },
    mounted: function () {
        console.log("Hello 组件被挂载，渲染了")
    },
    methods: {
        fun() {
            alert("电影收藏成功！")
        }
    }
}
</script>

<style></style>